class CommentsController < ApplicationController
  def index
   @sid = params[:sid]
   if params[:fb_sig_xid_action] == "post"
     params[:sid] = params[:fb_sig_xid].split("_").last
     m = Match.find(params[:sid].to_i)
     m.comment_count = m.comment_count.to_i + 1
     m.save
     current_user.add_point(PointConfig.find_by_name("user_comment").point)
   elsif params[:fb_sig_xid_action] == "delete"
     params[:sid] = params[:fb_sig_xid].split("_").last
     m = Match.find(params[:sid].to_i)
     m.comment_count = m.comment_count.to_i - 1  if m.comment_count.to_i > 1
     m.save
     current_user.add_point(-PointConfig.find_by_name("user_comment").point)
   else
     params[:sid] = params[:fb_sig_xid].split("_").last if @sid.nil?
   end
   render :partial=> "index",:locals=>{:sid=>params[:sid]},:layout=>false
  end

  def show
  end

  def create
  end
  
end
